import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router' //引入

Vue.use(VueRouter);

//创建组件
import News from './components/components/News.vue'
import Info from './components/components/Info.vue'

//配置路由
const routes = [
  {path:"/news",component:News},
  {path:"/info",component:Info},
  {path:"*",redirect:"/news"}
];

//实例化路由
const router = new VueRouter({
  routes
});

//挂载路由
new Vue({
  el: '#app',
  router,
  render: h => h(App)
});
